Developer Documentation

QuickTime 4 API Documentation

QuickTime Music Architecture

| Previous | Chapter Contents | Chapter Top | Next |

Note Event and Extended Note Event

The standard note event ( Figure 5 ) supports most music requirements. The note event allows up to 32 parts, numbered 0 to 31, and support pitches from 2 octaves below middle C to 3 octaves above. The extended note event ( Figure 6 ) provides a wider range of pitch values, microtonal values to define any pitch, and extended note duration. The extended note event requires two long words; the standard note event requires only one.

Figure 5 note event

Table 2 Contents of a note event

note event type First nibble value = 001X
Part number Unique part identifier
Pitch Numeric value of 0-63, mapped to 32-95
Velocity 0-127, 0 = no audible response (but used to indicate a NOTE OFF)
Duration Specifies how long to play the note in units defined by the media time scale or tune player time scale

The part number bit field contains the unique part identifier initially used during the TuneSetHeader call.

The pitch bit field allows a range of 0-63, which is mapped to the values 32-95 representing the traditional equal tempered scale. For example, the value 28 (mapped to 60) is middle C.

The velocity bit field allows a range of 0-127. A velocity value of 0 produces silence.

The duration bit field defines the number of units of time during which the part will play the note. The units of time are defined by the media time scale or tune player time scale.

Use this macro call to stuff the note event's long word:

qtma_StuffNoteEvent(x, instrument, pitch, volume, duration)

Use these macro calls to extract fields from the note event's long word:

qtma_Instrument(x)
qtma_NotePitch(x)
qtma_NoteVelocity(x)
qtma_NoteVolume(x)
qtma_NoteDuration(x)

Figure 6 Extended note event

Table 3 Contents of an extended note event

Extended note event type First nibble value = 1001
Part number Unique part identifier
Pitch 0-127 standard pitch, 60 = middle C 0x01.00 ... 0x7F.00 allowing 256 microtonal divisions between each notes in the traditional equal tempered scale
Velocity 0-127 where 0 = no audible response (but used to indicate a NOTE OFF)
Duration Specifies how long to play the note in units defined by media time scale or tune player time scale
Event tail First nibble of last word = 10XX

The part number bit field contains the unique part identifier initially used during the TuneSetHeader call.

If the pitch bit field is less than 128, it is interpreted as an integer pitch where 60 is middle C. If the pitch is 128 or greater, it is treated as a fixed pitch.

Microtonal pitch values are produced when the 15 bits of the pitch field are split. The upper 7 bits define the standard equal tempered note and the lower 8 bits define 256 microtonal divisions between the standard notes.

Use this macro call to stuff the extended note event's long words:

qtma_StuffXNoteEvent(w1, w2, instrument, pitch, volume, duration)

Use these macro calls to extract fields from the extended note event's long words:

qtma_XInstrument(m, l)
qtma_XNotePitch(m, l)
qtma_XNoteVelocity(m, 1)
qtma_XNoteVolume(m, l)
qtma_XNoteDuration(m, l)

© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |